﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace _010_011_012操作符详解_3_
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //字典中的类型
            //string 是索引类型  Student 是值类型
            Dictionary<string,Student>stuDic = new Dictionary<string,Student>();
            for (int i = 0; i < 100; i++) { 
            
            Student student = new Student();
            student.Name="s_"+i.ToString();
            student.Score = 100-i;
            stuDic.Add(student.Name, student);
            }

            Student number6 = stuDic["s_99"];
            Console.WriteLine(number6.Name);
            Console.WriteLine(number6.Score);

            //typeof操作符  Metadata
            Type t = typeof(int);

            Console.WriteLine(t.Namespace);
            Console.WriteLine(t.FullName);
            Console.WriteLine(t.Name);

            int c = t.GetMethods().Length;
            foreach(var mi in t.GetMethods())
            {
                Console.WriteLine(mi);
            }

            //default 操作符
            int a =default(int);
            Console.WriteLine(a); //0

            //引用类型也一样
            Form form =default (Form);
            Console.WriteLine(form==null);

            Level level=default(Level);
            Console.WriteLine(level);
        }
    }

    class Student{
        public string Name;
        public int Score; 
    }

    enum Level
    {
        Low,
        Medium, 
        High
    }
}
